import Vue from "vue";
import Router from "vue-router";
// 首页
import home from "@/views/home/index";
import homepage from "@/views/homepage/index";
// 职位列表
import PositionList from "@/views/PositionList/index";
import Jobdetails from "@/views/Jobdetails/index";
import delivered from "@/views/Jobdetails/delivered";
import companyDetails from "@/views/Jobdetails/companyDetails";
// 我的简历
import Myresume from "@/views/Myresume/index";
import resumeRemove from "@/views/Myresume/resumeRemove";
// 投递记录
import Deliveryrecord from "@/views/Deliveryrecord/index";
// 我的收藏
import Mycollection from "@/views/Mycollection/index";
// 教育经历
import educationadd from "@/views/educationadd/index";
import schoolName from "@/views/educationadd/schoolName";

import educationTime from "@/views/educationadd/educationTime";
// 工作经历
import workExperienceAdd from "@/views/workExperienceAdd/index";
import corporateName from "@/views/workExperienceAdd/corporateName";
import worktime from "@/views/workExperienceAdd/worktime";
import positionCategory from "@/views/workExperienceAdd/positionCategory";
// 招聘会
import jobfair from "@/views/jobfair/index";
import careerfair from "@/views/jobfair/careerfair";
// 我的
import Mydocuments from "@/views/Mydocuments/index";
// 聊天
import seealsolist from "@/views/seealsolist/index";
import master from "@/components/master/master";
// 后台管理数据
import dataanalysis from "@/views/dataanalysis/index";
import unemploy from "@/views/unemploy/index";
import unemployedadd from "@/views/unemploy/unemployedadd";
import employmentRegistrationAdd from "@/views/unemploy/employmentRegistrationAdd";
import dressing from "@/components/dressing/dressing";

// 登录
import login from "@/views/login/index";
import wxlogin from "@/views/login/wxlogin";
import wxloginpost from "@/views/login/wxloginpost";
import wxloginresume from "@/views/login/wxloginresume";

// 注册
import register from "@/views/register/index";

// 报名成功
import applySuccess from "@/views/applySuccess/index";

// 我的
import mine from "@/views/mine/index";

// 设置
import setting from "@/views/setting/index";

// 个人信息
import myInfo from "@/views/myInfo/index";

// 切换身份
import switchIdentity from '@/views/switchIdentity/index';
//新闻
import newsMenu from '@/views/newsMenu/index';
import newsDetail from '@/views/newsDetail/index';
import newsList from '@/views/newsList/index';
Vue.use(Router);
const VueRouterPush = Router.prototype.push;
Router.prototype.push = function push(to) {
  return VueRouterPush.call(this, to).catch(err => err);
};
export default new Router({
  routes: [
    {
      path: "/wxlogin",
      name: "wxlogin",
      component: wxlogin
    },
    {
      path: "/wxloginpost",
      name: "wxloginpost",
      component: wxloginpost
    },
    {
      path: "/wxloginresume",
      name: "wxloginresume",
      component: wxloginresume
    },
    {
      path: "/",
      name: "home",
      component: home,
      children: [
        {
          path: "/homepage",
          name: "homepage",
          component: homepage
        },
        {
          path: "/PositionList",
          name: "PositionList",
          component: PositionList
        },
        {
          path: "/Jobdetails",
          name: "Jobdetails",
          component: Jobdetails
        },
        {
          path: "/Myresume",
          name: "Myresume",
          component: Myresume
        },
        {
          path: "/resumeRemove",
          name: "resumeRemove",
          component: resumeRemove
        },
        {
          path: "/Deliveryrecord",
          name: "Deliveryrecord",
          component: Deliveryrecord
        },
        {
          path: "/Mycollection",
          name: "Mycollection",
          component: Mycollection
        },
        // 教育经历
        // {
        //   path: '/educationadd',
        //   name: 'educationadd',
        //   component: educationadd
        // },
        {
          path: "/schoolName",
          name: "schoolName",
          component: schoolName
        },

        {
          path: "/educationTime",
          name: "educationTime",
          component: educationTime
        },

        // 工作经历
        // {
        //   path: '/workExperienceAdd',
        //   name: 'workExperienceAdd',
        //   component: workExperienceAdd
        // },
        {
          path: "/corporateName",
          name: "corporateName",
          component: corporateName
        },
        {
          path: "/worktime",
          name: "worktime",
          component: worktime
        },
        {
          path: "/positionCategory",
          name: "positionCategory",
          component: positionCategory
        },
        {
          path: "/delivered",
          name: "delivered",
          component: delivered
        },
        {
          path: "/companyDetails",
          name: "companyDetails",
          component: companyDetails
        },
        {
          path: "/jobfair",
          name: "jobfair",
          component: jobfair
        },
        {
          path: "/careerfair",
          name: "careerfair",
          component: careerfair
        },
        {
          path: "/Mydocuments",
          name: "Mydocuments",
          component: Mydocuments
        },
        {
          path: "/seealsolist",
          name: "seealsolist",
          component: seealsolist
        }
      ]
    },
    {
      path: "/workExperienceAdd",
      name: "workExperienceAdd",
      component: workExperienceAdd
    },
    {
      path: "/educationadd",
      name: "educationadd",
      component: educationadd
    },
    {
      path: "/master",
      name: "master",
      component: master
    },
    {
      path: "/dressing",
      name: "dressing",
      component: dressing
    },
    {
      path: "/dataanalysis",
      name: "dataanalysis",
      component: dataanalysis
    },
    {
      path: "/unemploy",
      name: "unemploy",
      component: unemploy
    },
    {
      path: "/employmentRegistrationAdd",
      name: "employmentRegistrationAdd",
      component: employmentRegistrationAdd
    },
    {
      path: "/unemployedadd",
      name: "unemployedadd",
      component: unemployedadd
    },
    {
      path: "/login",
      name: "login",
      component: login
    },
    {
      path: "/register",
      name: "register",
      component: register
    },
    {
      path: "/applySuccess",
      name: "applySuccess",
      component: applySuccess
    },
    {
      path: "/mine",
      name: "mine",
      component: mine
    },
    {
      path: "/setting",
      name: "setting",
      component: setting
    },
    {
      path: "/myInfo",
      name: "myInfo",
      component: myInfo
    },
    {
      path: "/switchIdentity",
      name: "switchIdentity",
      component: switchIdentity
    },
    {
      path: "/newsMenu/:id",
      name: "newsMenu",
      component: newsMenu
    },
    {
      path: "/newsDetail/:newsId",
      name: "newsDetail",
      component: newsDetail
    },
    {
      path: "/newsList/:menuId",
      name: "newsList",
      component: newsList
    }
  ]
});
